(0) Obligation:
JBC Problem based on JBC Program:
Manifest-Version: 1.0
Created-By: 1.6.0_26 (Sun Microsystems Inc.)
Main-Class: simple/whileBreak/Main
package simple.whileBreak;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
WhileBreak.loop(args.length);
}
}
package simple.whileBreak;
public class WhileBreak {
public static void loop(int i) {
while (i > 10) {
if (i > 20) {
i++;
} else {
i--;
}
if (i == 30) {
break;
}
}
}
}
(1) JBCNonTerm (EQUIVALENT transformation)
Reached a loop using the following run:
0:
<simple.whileBreak.Main.main||0: load ADDR args||args: a62|| ->
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a60
String.CASE_INSENSITIVE_ORDER: o31
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o31!: String$CaseInsensitiveComparator()
a60([java.io.ObjectStreamField|]): length 0
a62([java.lang.String...]): length 30
1:
<simple.whileBreak.Main.main||1: arraylength|| - ||a62>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a60
String.CASE_INSENSITIVE_ORDER: o31
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o31!: String$CaseInsensitiveComparator()
a60([java.io.ObjectStreamField|]): length 0
a62([java.lang.String...]): length 30
2:
<simple.whileBreak.Main.main||2: simple.whileBreak.WhileBreak.loop(I)V|| - ||30>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a60
String.CASE_INSENSITIVE_ORDER: o31
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o31!: String$CaseInsensitiveComparator()
a60([java.io.ObjectStreamField|]): length 0
a62([java.lang.String...]): length 30
3:
<simple.whileBreak.WhileBreak.loop||0: load INT i||i: 30|| ->
<simple.whileBreak.Main.main||2: simple.whileBreak.WhileBreak.loop|| - ||30>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a60
String.CASE_INSENSITIVE_ORDER: o31
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o31!: String$CaseInsensitiveComparator()
a60([java.io.ObjectStreamField|]): length 0
a62([java.lang.String...]): length 30
In the loop head node, references [i22] were interesting.
By SMT, we could prove
((0 <= initial_i22 and 0 <= initial_i21) and ((((path1_i22 = path1_i32 and path1_i32 = path1_i36 and path1_i40 = (path1_i36 + -1) and path1_i40 = res_i22 and path1_i21 = res_i21 and path1_i22 = initial_i22 and path1_i21 = initial_i21) and (path1_i32 > 10 and path1_i36 <= 20 and path1_i40 > 30)) or ((path2_i22 = path2_i32 and path2_i32 = path2_i38 and path2_i41 = (path2_i38 + 1) and path2_i41 = path2_i88 and path2_i88 = res_i22 and path2_i21 = res_i21 and path2_i22 = initial_i22 and path2_i21 = initial_i21) and (path2_i32 > 10 and path2_i38 > 20 and path2_i88 > 30))) and (((res_i22 = res_i32 and res_i32 = res_i36 and res_i40 = (res_i36 + -1)) and !(res_i32 > 10 and res_i36 <= 20 and res_i40 != 30)) and ((res_i22 = res_i32 and res_i32 = res_i38 and res_i41 = (res_i38 + 1) and res_i41 = res_i88) and !(res_i32 > 10 and res_i38 > 20 and res_i88 != 30)))))
to be UNSAT. Consequently, the loop will not terminate.